Skip to content

Conversation

jfcartier
Copy link
Contributor

Currently, there's a global postRender process and it works like a charm. But I think there's missing something; a postRender for Promises as a callback.

To justify this proposition, here's a case

Lets say we have an "AddToCalendar" link inside each views row.
So when we call theme_view, theres nothing we can do to add an event on each links.
Global postRender is of course triggered before the view query. If jQuery is installed, we could add the ".on()" function on body, but it's not really interesting since my solution solves that problem.

What do you think?

Currently, there's a global postRender process, it works like a charm, but I think there's missing something. A postRender for Promises, like a callback.

To justify this proposition, here's a case :

Lets say we have an "AddToCalendar" link inside each views row. 
So when we call theme_view, theres nothing we can do to add an event on each links.
Global postRender is of course triggered before the view query. We could add a jQuery ".on()" function on body, but it's not really interesting since my solution here solve that problem.

What do you think?
It could be useful to have the views results. We could want to manipulate something with data.attributes or even check what the view's output is to make something if its empty or not.
@jfcartier
Copy link
Contributor Author

Example of usage :

{
  _theme: 'view',
  _path: 'viewspath',
  _callback: [function(data){
    console.log(data);
  }],
  _row_callback: function(row) {
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant